<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core">
	
<h:outputStylesheet name="styles.css" library="css" />

<h:head>
	<title>#{user.openThread.title}</title>
</h:head>

<h:body><div class="main">
	<h:form><h:commandLink value="Home" action="index" /> \ <h:commandLink value="#{user.openCategory}" action="categori" /></h:form>
	<h:form>
	<h:dataTable value="#{service.posts(user.openThread)}" var="post">
		<h:column>
			<table cellspacing="0" cellpadding="0">
			<tr><td class="post_top">#{post.title}</td><td class="post_top_right">#{post.timeStamp}&nbsp;<h:commandButton class="delButton" value="X" action="#{service.deletePost(post)}" rendered="#{user.canDelete()}"/></td></tr>
			<tr><td class="post" colspan="2">#{post.content}</td></tr>
			</table>
		</h:column>
	</h:dataTable>
	</h:form>
	
	<h:form rendered="#{user.canPost()}">
	<table cellspacing="0" cellpadding="0" class="post">
		<tr><td><h:inputText value="#{user.title}" class="inputField" /></td></tr>
		<tr><td rowspan="3"><h:inputTextarea value="#{user.content}" class="inputField" /></td></tr>
		<tr><td><h:commandButton value="submit" action="#{user.submit}" class="sendButton" /></td></tr>
	</table>
	</h:form>

</div>
</h:body>
</html>